

type HTTPStatus = 'pedding' | 'complete' | 'error';
interface HTTPXHR {
  status: HTTPStatus;
  expire: number;
  promise: Promise<any>;
}
export class HTTPStatusManager {
  private _cache = new Map<string, HTTPXHR>();

  public set(uuid: string, cache: HTTPXHR): void {
    this._cache.set(uuid, cache);
  }

  public get(uuid: string): HTTPXHR | undefined {
    return this._cache.get(uuid);
  }

  public delete(uuid: string): void {
    this._cache.delete(uuid);
  }

  public clear(): void {
    this._cache.clear();
  }
}
/**
 * HTTPStatusManager.set(key, {
    status: 'complete',
    expies: nowTime + dedupingInterval,
    promise: Promise.resolve(result),
  })
 */
